import request from '@/config/axios'

// 班级 VO
export interface ClassesVO {
  className: string // 班级名称
  gradeName: string // 年级名称
  classOwner: number // 班主任
  ownerName: string // 班主任姓名
}

// 班级 API
export const ClassesApi = {
  // 查询班级分页
  getClassesPage: async (params: any) => {
    return await request.get({ url: `/system/classes/page`, params })
  },
  getClasseslist: async (params: any) => {
    return await request.get({ url: `/system/classes/list`, params })
  },

  // 查询班级详情
  getClasses: async (id: number) => {
    return await request.get({ url: `/system/classes/get?id=` + id })
  },

  // 新增班级
  createClasses: async (data: ClassesVO) => {
    return await request.post({ url: `/system/classes/create`, data })
  },

  // 修改班级
  updateClasses: async (data: ClassesVO) => {
    return await request.put({ url: `/system/classes/update`, data })
  },

  // 删除班级
  deleteClasses: async (id: number) => {
    return await request.delete({ url: `/system/classes/delete?id=` + id })
  },

  // 导出班级 Excel
  exportClasses: async (params) => {
    return await request.download({ url: `/system/classes/export-excel`, params })
  }
}